<?php

/*
* Update the value (points) of all pile divs.
*
* @header project Name of the project 
* @header val Selected option in the div
* @header note Note ID
* 
* @return mysql_error()
*          if there was an error updating the database
* @return "success"
*          upon success
*/


require_once("session.php");
require_once("connect_to_database.php");

$project = $_POST['project'];
$val = $_POST['val'];
$note = $_POST['note'];

// Update note points with the selected option


	$query = sprintf("UPDATE `%s` SET points='%s' WHERE id='%s'", $project,$val,$note);
	$result = mysql_query($query);

	if(!$result){
		error_log($query.mysql_error());
		die(mysql_error());
	}
	echo("success");


?>